package com.hb.trade.server.project.file.service;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hb.core.pojo.project.file.dto.BidBuyRecordDTO;
import com.hb.core.pojo.project.file.entity.BidBuyRecord;

import java.util.List;

/**
 * <p>
 * 供应商购标记录表 服务类
 * </p>
 *
 * @author zhaojk
 * @since 2021-09-16
 */
public interface BidBuyRecordService extends IService<BidBuyRecord> {

    /**
     * 查询指定标段的标书售卖记录
     *
     * @param sectionId
     * @return
     */
    Page<BidBuyRecordDTO> saleRecord(Page page, Long sectionId);

    /**
     * 查询指定标段的招标文件售卖信息
     *
     * @param sectionId
     * @return
     */
    JSONObject sectionSaleInfo(Long sectionId);

    /**
     * 根据订单号查询领购记录信息
     *
     * @param orderNo
     * @return
     */
    BidBuyRecord findBidBuyRecordByOrderNo(String orderNo);


    /**
     *
     * @Description: 需要报名费的文件判断是否购买成功
     * @Author: zhongdl
     * @Date:2022/1/4 13:51
     * @param sectionId:  标段id
     * @param buyUserId: 购标人id
     * @param orgId: 企业id
     * @return: {@link Boolean }
     **/
    Boolean  payFlag(Long sectionId,Long buyUserId,Long orgId);
    /**
     *
     * @Description: 查询当前企业和账户是否购买了标书
     * @Author: zhongdl
     * @Date:2022/1/28 09:31
     * @param sectionId:  标段id
     * @param buyUserId: 购标人id
     * @param orgId: 企业id
     * @return: {@link Boolean }
     **/
    BidBuyRecord getBidBuyRecordByOrgId(Long sectionId,Long buyUserId,Long orgId);
}
